package Java字符串;

public class 查询字符串最后一次出现的位置 {
        public static void main(String[] args) {
			String string="Hello word,Hello reader";
			int lastIndex=string.lastIndexOf("Hello");
			if(lastIndex==-1){
				System.out.println("Hello not found");
			}
			else{
				System.out.println("Lastoccurrence of Hello is at index "+lastIndex);
			}
		}
}
